<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>核销记录</title>
<link rel="stylesheet" type="text/css" href="css/lib/swiper.min.css"/>
<link rel="stylesheet" type="text/css" href="css/lib/doumee.css"/>
<link rel="stylesheet" type="text/css" href="css/public.css"/>
<link rel="stylesheet" type="text/css" href="css/caseMod.css"/>
<link rel="stylesheet" type="text/css" href="css/order.css"/>
<script src="js/lib/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
<script src="js/lib/swiper.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/lib/vue-2.5.17.js" type="text/javascript" charset="utf-8"></script>
<script src="js/lib/doumee.js" type="text/javascript" charset="utf-8"></script>
<script src="js/lib/dialog.js" type="text/javascript" charset="utf-8"></script>
<script src="js/lib/picker.js" type="text/javascript" charset="utf-8"></script>
<script src="js/data.js" type="text/javascript" charset="utf-8"></script>
</head>

<body>

<header class="header">
	<a class="left_icon back_btn"></a>
	<h4 class="title">核销记录</h4>
</header>

<nav class="dm-mainNav flex-row bg-w bottom-line" id="logTab">
	<a class="flex-full" onclick="historyTab(0)">已核销订单</a>
	<a class="flex-full" onclick="historyTab(1)">已核销优惠券</a>
</nav>

<div class="swiper-container Main" id="Main">
	<div class="swiper-wrapper">
		<div class="swiper-slide content">
			
			<div class="children" id="orderMod">
				
				<div class="list">
					<ul class="order-box bg-w">
						<li class="top bottom-line">
							<div class="photo dm-left">
								<img src="image/test/pro-1.png" />
							</div>
							<h5 class="name dm-left">王多鱼</h5>
							<h5 class="statu dm-right">2018.10.16</h5>
						</li>
						<li class="wrap dm-clearfix" onclick="location.href='orderDetail.html'">
							<div class="pt cover" data-rate='1'>
								<img src="image/test/pro-1.png" />
							</div>
							<div class="pt cover" data-rate='1'>
								<img src="image/test/pro-1.png" />
							</div>
							<div class="pt cover" data-rate='1'>
								<img src="image/test/pro-1.png" />
							</div>
							<div class="pt cover" data-rate='1'>
								<img src="image/test/pro-1.png" />
							</div>
							<div class="pt cover" data-rate='1'>
								<img src="image/test/pro-1.png" />
								<span class="num flex-row">+2</span>
							</div>
						</li>
						<li class="top-line info tr">共计6件商品 合计: <span class="red">￥2400.00</span></li>
						<li class="bot top-line flex-row">
							<div class="txt flex-full">朱无视 于 2018-10-12 核销此订单</div>
						</li>
					</ul>
				</div>
				
				<!--优惠券-->
				<div class="wealMod bg-w homeMod" id="weal" style="padding-top: 14px;display: none;">
				
					<div class="weal-wrap" v-for="(item,index) in wealData">
						
						<ul class="weal-box" type="1">
							<li class="main-info flex-row">
								<div class="val">
									<span class="unit">￥</span>{{item.val}}
								</div>
								<div class="flex-full info flex-row">
									<dl class="flex-full">
										<dt>{{item.type}}</dt>
										<dd>{{item.start}} ~ {{item.end}}</dd>
									</dl>
									<div class="btn">已核销</div>
								</div>
							</li>
							<li class="ex-info flex-row" @click="controlRuler($event)">
								<div class="flex-full ruler animate dm-wrap">{{item.rule}}</div>
								<a class="btn animate"></a>
							</li>
						</ul>
						<dl class="dm-clearfix oth-info h5">
							<dt class="dm-left name">核销人：王多鱼</dt>
							<dd class="dm-right txt">核销时间：2018-09-10</dd>
						</dl>
						
					</div>
					
				</div>
				
				<!--空数据-->
				<div class="emptyMod nullMod" style="display: none;">
					<div class="icon">
						<img src="image/empty/order_empty.png" />
					</div>
					<div class="txt">暂无核销记录<br />快去给你的粉丝会员推送最新商品!</div>
				</div>
				<!--空数据 end-->
				
				<!--网络错误-->
				<div class="emptyMod netError" style="display: none;">
					<div class="icon">
						<img src="image/empty/netError.png" />
					</div>
					<div class="txt">网络开小差了，快去检查一下你的网络</div>
				</div>
				<!--网络错误 end-->
				
				<!--加载失败-->
				<div class="emptyMod netError" style="display: none;">
					<div class="icon">
						<img src="image/empty/loadError.png" />
					</div>
					<div class="txt">哎呀,页面没有加载出来!<br />尝试重新加载吧</div>
				</div>
				<!--加载失败 end-->
				
			</div>
			
		</div>
	</div>
</div>

<script type="text/javascript">

var vm = new Vue({
	el:'#Main',
	data:{
		wealData:data.weal,
	},
	methods:{
		//收放优惠券详情
		controlRuler:function(e){
			var node = e.currentTarget.children;
			if(node[1].className.indexOf('active') < 0){
				//展开
				node[0].className = 'flex-full ruler animate';
				node[1].className = 'btn animate active';
			}else{
				//收起
				node[0].className = 'flex-full ruler animate dm-wrap';
				node[1].className = 'btn animate';
			};
		},
	},
	created:function(){
		var type = getUrlParam('type');
		type == null ? type = 0 : type;
		$("#logTab").children().eq(type).addClass('on');
		if(type == 0){
			$("#orderMod .list").show();
			$("#weal").hide();
		}else{
			$("#orderMod .list").hide();
			$("#weal").show();
		};
	},
	mounted:function(){
		new copy('#orderMod .list',19).data();
		pullSwiper('#Main',{
			up:true,//启动下拉刷新,也可自定义函数，默认禁用
			down:true,//启用上拉加载,也可自定义函数，默认禁用
		});
	},
});


function refresh(pull){
	pull.innerHTML = '刷新完成';
};

function reload(pull){
	pull.innerHTML = '已加载全部数据';
};

//切换
function historyTab(type){
	location.replace('log_history.html?type='+type);
};

//设置问题类模块的高度
$(".emptyMod").height($("#Main").height());

</script>

</body>
</html>
